package com.wteam.PoJo.VO;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel
public class member {

    @ApiModelProperty(required = false)
    private Integer id;

    @NotEmpty(message = "用户名必填")
    @Size(max = 30, message = "用户名最长30位")
    @ApiModelProperty(value = "用户名(唯一)", required = true)
    private String username;

    @NotEmpty(message = "密码不能为空")
    @ApiModelProperty(value = "密码", required = true)
    @TableField(select = false)//不参与查询
    private String password;

    @NotEmpty(message = "手机号码不能为空")
    @ApiModelProperty(value = "手机号码（唯一）", required = true)
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String mobile;

//    private LocalDateTime birthday;

    @NotEmpty(message = "昵称必填")
    @Size(max = 30, message = "昵称最长30位")
    @ApiModelProperty(value = "昵称", required = true)
    private String nickName;

    @NotNull(message = "性别必填")
    @ApiModelProperty(value = "性别（1：男，2：女）", required = true)
    private Integer sex;

    @ApiModelProperty(value = "生日",required = false ,example = "2021-05-17 00:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime birthday;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime CreateTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime UpdateTime;

    @ApiModelProperty( required = false)
    private String UpdateBy;



}
